package cn.edu.zust.zql.controller;

import cn.edu.zust.zql.model.Subject;
import cn.edu.zust.zql.service.SubjectService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2016/12/22.
 */
@Controller
@RequestMapping("subject")
public class SubjectController {
    @Resource
    private SubjectService subjectService;
    @RequestMapping("index")
    public ModelAndView index(ModelAndView mv){
        List<Subject> list = subjectService.getAllSubject();
        mv.addObject("data", list);
        mv.setViewName("jsp/subject");
        return mv;
    }


}
